<template>
  <div>
    <common-head title="新增收获地址" bg="rgb(0, 204, 255)" />
    <div class="main">
         <van-address-edit
        :area-list="areaInfo"
        show-postal
        show-set-default
        :area-columns-placeholder="['省', '市', '区']"
        @save="onSave"
      />
    </div>
  </div>
</template>

<script>
import CommonHead from '@components/CommonHead'
import { mapState, mapMutations } from 'vuex'
export default {
  methods: {
    onSave (address) {
      address.id = new Date().getTime()
      this.addContact(address)
      this.$toast('添加成功')
      this.$router.go(-1)
    },
    ...mapMutations(['addContact'])
  },
  computed: {
    ...mapState(['areaInfo'])
  },
  components: {
    CommonHead
  }
}
</script>

<style lang="scss" scoped>
</style>
